<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/font-awesome/css/font-awesome.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<div class='form-group'>
				<label class='col-md-2 control-label'>审批状态</label>

				<div class='col-md-10'>
					<select name="status" class='form-control'>
						<option value="PASS">通过</option>
						<option value="NOTPASS">不通过</option>
					</select>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>审批意见</label>
				<div class='col-md-10'>
					<textarea class='form-control' type='text' id='handleOpinion' name="handleOpinion"></textarea>
				</div>
			</div>
			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
						<input type="hidden" class="form-control" id="id" name="id"/>
						<button class="btn btn-primary" onclick="location.href='appealList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="saveAduit()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>
		</fieldset>
	</form>
</div>

	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../js/my/ztree-menu.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use('layer', function(){
		    var layer = layui.layer;

            initData();
		});
		
		function saveAduit() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    var formdata = $("#form").serializeObject();
            $.ajax({
                type: 'post',
                url: '/empAppeal/aduit',
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify(formdata),
                success: function (data) {
                    layer.msg("操作成功", {shift: -1, time: 1000}, function () {
                        location.href = "appealList.html";
                    });
                }
            });
		}

        function initData() {
            var id = getUrlParam("id");
            $("#id").val(id);
        }
	</script>
</body>
</html>